const express = require('express')
const router = express()

const handler = require('../router_handler/majorcate')

// 导入验证数据的中间件
const expressJoi = require('@escook/express-joi')
// 导入文章分类的验证模块
const { 
    update_cate_schema,
    add_cate_schema,
    delete_cate_schema
 } = require('../schema/majorcate')

// 获取专业分类
router.get('/', handler.getMajorCate)

// 更新
router.post('/update', expressJoi(update_cate_schema), handler.updateMajorCate)

// 新增
router.post('/add', expressJoi(add_cate_schema), handler.addMajorCate)

// 删除
router.get('/delete/:id', expressJoi(delete_cate_schema), handler.deleteMajor)


module.exports = router;











module.exports = router